home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
demo
/
vtskt10i.zip
/
SERVER.FRM
< prev
next >
Wrap
Text File
|
1993-12-26
|
2KB
|
103 lines
VERSION 2.00
Begin Form Form1
Caption = "VTSocket Server"
ClientHeight = 1920
ClientLeft = 1095
ClientTop = 1470
ClientWidth = 5295
Height = 2325
Left = 1035
LinkTopic = "Form1"
ScaleHeight = 1920
ScaleWidth = 5295
Top = 1125
Width = 5415
Begin WinSock WinSock1
Client_or_Server= 1 'Server
Index = 0
Interval = 0
IPName = ""
Left = 4440
LicDate = 0
License1 = ""
License2 = ""
Licensed = 0
Linger = 0 'False
Port = 0
RecvBufSize = 0
SendBufSize = 0
Top = 1230
End
Begin CommandButton listen
Caption = "Listen"
Height = 435
Left = 4140
TabIndex = 1
Top = 660
Width = 1095
End
Begin ListBox List1
Height = 1785
Left = 60
TabIndex = 0
Top = 60
Width = 3975
End
End
Dim cnt As Integer
Sub Form_Load ()
MsgBox winsock1(0).Description
End Sub
Sub Form_Unload (Cancel As Integer)
If winsock1(0).Open Then
winsock1(0).Open = False
End If
End Sub
Sub listen_Click ()
winsock1(0).Port = 23
winsock1(0).Open = True
cnt = cnt + 1
list1.AddItem Format$(cnt, "###") + " Listening on port " + Str$(winsock1(0).Port), 0
End Sub
Sub WinSock1_Connect (index As Integer, ID As Integer)
cnt = cnt + 1
list1.AddItem Format$(cnt, "###") + " Connected on socket " + Str$(ID), 0
Load winsock1(ID)
End Sub
Sub WinSock1_Disconnect (index As Integer)
cnt = cnt + 1
list1.AddItem Format$(cnt, "###") + " Disconnect on socket " + Str$(index), 0
If index > 0 Then
Unload winsock1(index)
Else
MsgBox ("Close received for listening socket, terminating")
End
End If
End Sub
Sub WinSock1_Recv (index As Integer)
cnt = cnt + 1
list1.AddItem Format$(cnt, "###") + " RECV: '" + winsock1(index).Recv + "' from socket=" + Str$(index), 0
cnt = cnt + 1
list1.AddItem Format$(cnt, "###") + " SEND: Hi there!! in response", 0
winsock1(index).Send = "Hi there!!"
End Sub